# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=libdca
pkgver=0.0.5
pkgrel=5
pkgdesc="Free library for decoding DTS Coherent Acoustics streams"
arch=('i686' 'x86_64')
license=('GPL')
url="https://www.videolan.org/developers/libdca.html"
depends=('sh')
provides=('libdts')
replaces=('libdts')
options=('!emptydirs')
validpgpkeys=('8700D9088473D895D18CE0C4902817E4AA5F4DE6') # VideoLAN Release Signing Key (2007) (expired)
source=(https://download.videolan.org/pub/videolan/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2{,.sig})
sha256sums=('dba022e022109a5bacbe122d50917769ff27b64a7bba104bd38ced8de8510642'
            'SKIP')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --mandir=/usr/share/man --disable-static
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install

  rm -f "${pkgdir}/usr/share/man/man1"/{extract_dts,dtsdec}.1
  ln -s dcadec.1.gz "${pkgdir}/usr/share/man/man1/dtsdec.1.gz"
  ln -s extract_dca.1.gz "${pkgdir}/usr/share/man/man1/extract_dts.1.gz"
  rm -f "${pkgdir}/usr/lib/libdts.a"
}
